ioemu: Use asprintf instead of PATH_MAX, which POSIX says to be facultative.
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 23 Jan 2008 18:05:12 +0000 (18:05 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 23 Jan 2008 18:05:12 +0000 (18:05 +0000)
Signed-off-by: Samuel Thibault <samuel.thibault@eu.citrix.com>
tools/ioemu/target-i386-dm/helper2.c

index 2d347ccfbe83a07f991ad4837505c316f4455fe7..d3668ac64c8d70a8da1e1ea5e739ecb041ef099c 100644 (file)
@@ -635,7 +635,7 @@ int main_loop(void)
     extern int suspend_requested;
     CPUState *env = cpu_single_env;
     int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
-    char qemu_file[PATH_MAX];
+    char *qemu_file;
     fd_set fds;
     int ret = 0;
 
@@ -665,9 +665,9 @@ int main_loop(void)
         main_loop_wait(1); /* For the select() on events */
 
         /* Save the device state */
-        snprintf(qemu_file, sizeof(qemu_file), 
-                 "/var/lib/xen/qemu-save.%d", domid);
+        asprintf(&qemu_file, "/var/lib/xen/qemu-save.%d", domid);
         do_savevm(qemu_file);
+        free(qemu_file);
 
         xenstore_record_dm_state("paused");